{template 'common/header'}
	<ul class="nav nav-tabs">
		<li><a href="{php echo create_url('setting/category/post')}">添加分类</a></li>
		<li class="active"><a href="{php echo create_url('setting/category/display')}">管理分类</a></li>
	</ul>
	<div class="main">
		<div class="category">
			<form action="" method="post" onsubmit="return formcheck(this)">
			<table class="table table-hover">
				<thead>
					<tr>
						<th style="width:10px;"></th>
						<th style="width:60px;">显示顺序</th>
						<th>分类名称</th>
						<th style="width:80px;">设为栏目</th>
						<th style="width:80px;">操作</th>
					</tr>
				</thead>
				<tbody>
				{loop $category $row}
					<tr>
						<td>{if count($children[$row['id']]) > 0}<a href="javascript:;"><i class="icon-chevron-down"></i></a>{/if}</td>
						<td><input type="text" class="span1" name="displayorder[{$row['id']}]" value="{$row['displayorder']}"></td>
						<td><div class="type-parent">{$row['name']}&nbsp;&nbsp;{if empty($row['parentid'])}<a href="{php echo create_url('setting/category/post', array('parentid' => $row['id']))}"><i class="icon-plus-sign-alt"></i> 添加子分类</a>{/if}</div></td>
						<td>{php echo $row['enabled'] ? '是' : '否'}</td>
						<td><a href="{php echo create_url('setting/category/post', array('id' => $row['id']))}">编辑</a>&nbsp;&nbsp;<a href="{php echo create_url('setting/category/delete', array('id' => $row['id']))}" onclick="return confirm('确认删除此分类吗？');return false;">删除</a></td>
					</tr>
					{loop $children[$row['id']] $row}
					<tr>
						<td></td>
						<td><input type="text" class="span1" name="displayorder[{$row['id']}]" value="{$row['displayorder']}"></td>
						<td><div class="type-child">{$row['name']}&nbsp;&nbsp;{if empty($row['parentid'])}<a href="{php echo create_url('setting/category/post', array('parentid' => $row['id']))}"><i class="icon-plus-sign-alt"></i> 添加子分类</a>{/if}</div></td>
						<td>{php echo $row['enabled'] ? '是' : '否'}</td>
						<td><a href="{php echo create_url('setting/category/post', array('id' => $row['id']))}">编辑</a>&nbsp;&nbsp;<a href="{php echo create_url('setting/category/delete', array('id' => $row['id']))}" onclick="return confirm('确认删除此分类吗？');return false;">删除</a></td>
					</tr>
					{/loop}
				{/loop}
					<tr>
						<td></td>
						<td colspan="4">
							<a href="{php echo create_url('setting/category/post')}"><i class="icon-plus-sign-alt"></i> 添加新分类</a>
						</td>
					</tr>
					<tr>
						<td></td>
						<td colspan="4">
							<input name="submit" type="submit" class="btn btn-primary" value="提交">
							<input type="hidden" name="token" value="{$_W['token']}" />
						</td>
					</tr>
				</tbody>
			</table>
			</form>
		</div>
	</div>
{template 'common/footer'}